<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">设置里程碑计划状态</h4>
</div>
<div class="modal-body">
    <form role="form" class="validator_form" action="{:url('/Index/Project/Plan/status')}" id="statusProjectPlanForm" method="post">
        <input type="hidden" name="id" value="{$plan.id?=$plan.id}">
        <div class="box-body">
            <div class="form-group">
                <label>项目名称</label>
                <label class="form-control">{$plan.project["title"]}</label>

            </div>
            <div class="form-group">
                <label>计划名称</label>
                <label class="form-control">{$plan.title}</label>

            </div>

            <div class="form-group">
                <label>状态</label>
                <select name="status" class="form-control" required>
                    <option value="">请选择</option>
                    {volist  name="code_status" id="vo"}
                    <option value="{$vo.m_value}" {$vo['m_value']==$plan['status']?'selected="selected"':''}>{$vo.m_name}</option>
                    {/volist}
                </select>

            </div>
        </div>


        <div class="box-footer">
            <button type="submit" class="btn btn-primary">确认</button>
        </div>
    </form>
</div>
<script>
    $('.validator_form').bootstrapValidator().on('success.form.bv', function(e) {
        e.preventDefault();
        var $form = $(e.target);
        var bv = $form.data('bootstrapValidator');
        // 使用Ajax提交form表单数据
        $.post($form.attr('action'), $form.serialize(), function(result) {
            if (result.code == 1) {
                bootoast({
                    message: result.msg,
                    type: 'success',
                    position: 'right-top',
                    timeout: 2
                });
                setTimeout(function() {
                    window.location.href = result.url;
                }, 1500);

            } else {
                bootoast({
                    message: result.msg,
                    type: 'danger',
                    position: 'right-top',
                    timeout: 2
                });
            }
        });

    });
</script>